﻿//This is a cmocean colormap
//All credit to Kristen Thyng
//This colormap is under the MIT License
//All cmocean colormaps are available at https://github.com/matplotlib/cmocean/tree/master/cmocean/rgb

namespace ScottPlot.Drawing.Colormaps
{
    public class Tarn : IColormap
    {
        public string Name => "Tarn";

        public (byte r, byte g, byte b) GetRGB(byte value) =>
            (cmaplocal[value, 0], cmaplocal[value, 1], cmaplocal[value, 2]);

        private static readonly byte[,] cmaplocal = {
            { 23, 35, 14 },
            { 24, 37, 14 },
            { 25, 39, 14 },
            { 27, 41, 15 },
            { 28, 42, 15 },
            { 29, 44, 15 },
            { 31, 46, 16 },
            { 32, 48, 16 },
            { 33, 49, 16 },
            { 34, 51, 16 },
            { 35, 53, 16 },
            { 37, 55, 16 },
            { 38, 56, 16 },
            { 39, 58, 16 },
            { 40, 60, 16 },
            { 42, 61, 16 },
            { 43, 63, 15 },
            { 44, 65, 15 },
            { 46, 66, 15 },
            { 47, 68, 14 },
            { 48, 70, 14 },
            { 50, 71, 13 },
            { 52, 73, 12 },
            { 54, 74, 12 },
            { 57, 75, 12 },
            { 60, 77, 13 },
            { 63, 78, 14 },
            { 66, 79, 15 },
            { 68, 80, 16 },
            { 71, 81, 17 },
            { 74, 83, 18 },
            { 77, 84, 19 },
            { 79, 85, 20 },
            { 82, 86, 21 },
            { 85, 87, 22 },
            { 87, 88, 23 },
            { 90, 89, 24 },
            { 93, 91, 25 },
            { 96, 92, 26 },
            { 98, 93, 26 },
            { 101, 94, 27 },
            { 104, 95, 28 },
            { 107, 96, 29 },
            { 109, 97, 30 },
            { 112, 98, 31 },
            { 115, 99, 32 },
            { 118, 100, 33 },
            { 120, 102, 33 },
            { 123, 103, 34 },
            { 126, 104, 35 },
            { 129, 105, 36 },
            { 132, 106, 37 },
            { 134, 107, 38 },
            { 137, 108, 39 },
            { 140, 109, 39 },
            { 143, 110, 40 },
            { 146, 111, 41 },
            { 149, 112, 42 },
            { 152, 113, 43 },
            { 155, 114, 44 },
            { 158, 115, 45 },
            { 160, 116, 46 },
            { 163, 117, 47 },
            { 166, 118, 48 },
            { 169, 119, 49 },
            { 172, 120, 50 },
            { 175, 121, 51 },
            { 178, 122, 53 },
            { 181, 123, 54 },
            { 184, 124, 55 },
            { 187, 125, 57 },
            { 190, 126, 58 },
            { 193, 127, 60 },
            { 196, 128, 62 },
            { 198, 129, 65 },
            { 201, 130, 68 },
            { 203, 132, 72 },
            { 204, 134, 76 },
            { 205, 136, 79 },
            { 206, 138, 83 },
            { 207, 140, 87 },
            { 208, 143, 90 },
            { 209, 145, 93 },
            { 210, 147, 97 },
            { 210, 150, 100 },
            { 211, 152, 104 },
            { 212, 154, 107 },
            { 213, 156, 111 },
            { 214, 159, 114 },
            { 215, 161, 117 },
            { 216, 163, 121 },
            { 217, 166, 124 },
            { 218, 168, 128 },
            { 219, 170, 131 },
            { 219, 173, 135 },
            { 220, 175, 138 },
            { 221, 177, 142 },
            { 222, 179, 145 },
            { 223, 182, 149 },
            { 224, 184, 152 },
            { 225, 186, 156 },
            { 226, 189, 159 },
            { 227, 191, 163 },
            { 228, 193, 166 },
            { 229, 196, 170 },
            { 230, 198, 173 },
            { 231, 200, 177 },
            { 232, 203, 180 },
            { 233, 205, 184 },
            { 234, 208, 187 },
            { 235, 210, 191 },
            { 236, 212, 194 },
            { 237, 215, 198 },
            { 239, 217, 201 },
            { 240, 219, 205 },
            { 241, 222, 209 },
            { 242, 224, 212 },
            { 243, 227, 216 },
            { 244, 229, 219 },
            { 246, 232, 223 },
            { 247, 234, 226 },
            { 248, 236, 229 },
            { 249, 239, 233 },
            { 250, 241, 236 },
            { 251, 243, 239 },
            { 252, 245, 242 },
            { 252, 246, 244 },
            { 252, 247, 246 },
            { 252, 247, 246 },
            { 252, 247, 245 },
            { 251, 246, 243 },
            { 251, 245, 240 },
            { 249, 244, 237 },
            { 248, 242, 234 },
            { 246, 240, 231 },
            { 244, 238, 227 },
            { 242, 236, 224 },
            { 240, 234, 220 },
            { 239, 232, 216 },
            { 237, 230, 213 },
            { 235, 228, 209 },
            { 233, 226, 205 },
            { 231, 223, 202 },
            { 229, 221, 198 },
            { 227, 219, 194 },
            { 225, 217, 191 },
            { 223, 215, 187 },
            { 221, 214, 184 },
            { 218, 212, 180 },
            { 215, 210, 178 },
            { 212, 209, 175 },
            { 209, 207, 173 },
            { 206, 206, 171 },
            { 203, 204, 170 },
            { 199, 203, 168 },
            { 196, 201, 167 },
            { 193, 200, 166 },
            { 190, 198, 165 },
            { 186, 196, 164 },
            { 183, 195, 163 },
            { 180, 193, 162 },
            { 177, 192, 161 },
            { 174, 190, 160 },
            { 171, 189, 159 },
            { 168, 187, 158 },
            { 165, 185, 157 },
            { 162, 184, 156 },
            { 159, 182, 155 },
            { 156, 181, 154 },
            { 153, 179, 153 },
            { 151, 178, 152 },
            { 148, 176, 151 },
            { 145, 174, 150 },
            { 142, 173, 149 },
            { 139, 171, 148 },
            { 136, 170, 147 },
            { 133, 168, 146 },
            { 130, 167, 146 },
            { 127, 165, 145 },
            { 124, 164, 144 },
            { 121, 162, 143 },
            { 118, 161, 142 },
            { 115, 159, 141 },
            { 112, 158, 140 },
            { 109, 156, 139 },
            { 106, 155, 138 },
            { 103, 154, 137 },
            { 100, 152, 137 },
            { 97, 151, 136 },
            { 94, 149, 135 },
            { 90, 148, 134 },
            { 87, 146, 133 },
            { 84, 145, 133 },
            { 81, 143, 132 },
            { 78, 142, 131 },
            { 74, 140, 131 },
            { 71, 139, 130 },
            { 68, 137, 130 },
            { 65, 136, 129 },
            { 61, 134, 128 },
            { 58, 133, 128 },
            { 55, 131, 127 },
            { 52, 129, 127 },
            { 49, 128, 126 },
            { 46, 126, 126 },
            { 44, 124, 125 },
            { 42, 123, 125 },
            { 39, 121, 124 },
            { 37, 119, 124 },
            { 36, 117, 123 },
            { 34, 116, 122 },
            { 33, 114, 122 },
            { 32, 112, 121 },
            { 32, 110, 120 },
            { 31, 108, 119 },
            { 31, 106, 118 },
            { 30, 105, 118 },
            { 30, 103, 117 },
            { 29, 101, 116 },
            { 29, 99, 115 },
            { 28, 97, 114 },
            { 28, 95, 113 },
            { 27, 93, 112 },
            { 26, 92, 111 },
            { 26, 90, 111 },
            { 25, 88, 110 },
            { 24, 86, 109 },
            { 24, 84, 108 },
            { 23, 83, 107 },
            { 22, 81, 107 },
            { 21, 79, 106 },
            { 20, 77, 105 },
            { 19, 75, 104 },
            { 18, 73, 104 },
            { 17, 72, 103 },
            { 16, 70, 102 },
            { 16, 68, 101 },
            { 15, 66, 101 },
            { 14, 64, 100 },
            { 13, 62, 99 },
            { 12, 60, 99 },
            { 11, 59, 98 },
            { 10, 57, 98 },
            { 9, 55, 97 },
            { 9, 53, 96 },
            { 9, 51, 96 },
            { 9, 49, 95 },
            { 10, 47, 94 },
            { 11, 45, 93 },
            { 12, 42, 91 },
            { 13, 40, 89 },
            { 14, 38, 88 },
            { 14, 36, 86 },
            { 15, 34, 84 },
            { 15, 32, 82 },
            { 16, 30, 79 }

        };
    }
}

